from builder import MODELS
from mmcv.utils import build_from_cfg

from resnet import my_resnet50,my_ResNet # 注册进系统

# 配置文件
resnet_cfg = dict(type='my_ResNet', a=0, b="这个是类注册")
resnet1_cfg = dict(type='my_resnet50', a=1, b="这个返回的是实例")

# 创建配置文件
class_converter = build_from_cfg(resnet_cfg,MODELS)
converter=build_from_cfg(resnet1_cfg,MODELS)

print(class_converter)
print(converter)

# 调用函数
class_converter.my_print()
converter.my_print()